// utils/deepParse.js
export function deepParse(val) {
  let result = val;
  // 只要还是字符串，就继续尝试解析
  while (typeof result === 'string') {
    try {
      result = JSON.parse(result);
    } catch (e) {
      console.warn('deepParse warning, unable to parse:', result, e);
      // 解析失败了，跳出循环，返回当前值
      break;
    }
  }
  return result;
}
